<template>
  <ComponentContainerProperty v-model="formData.style">
    <template #default>
      <el-form :model="formData" label-width="80px">
        <!-- 图片配置 -->
        <el-form-item label="图片" prop="imageUrl">
          <UploadImg v-model="formData.imageUrl" :limit="1">
            <template #tip>建议尺寸 750x400px</template>
          </UploadImg>
        </el-form-item>
        
        <!-- 跳转链接 -->
        <el-form-item label="跳转链接" prop="linkUrl">
          <el-input 
            v-model="formData.linkUrl" 
            placeholder="请输入跳转链接"
            clearable
          />
        </el-form-item>
      </el-form>
    </template>
  </ComponentContainerProperty>
</template>

<script setup lang="ts">
import { SimpleImageLinkProperty } from './config'
import { useVModel } from '@vueuse/core'

defineOptions({ name: 'SimpleImageLinkProperty' })

const props = defineProps<{ modelValue: SimpleImageLinkProperty }>()
const emit = defineEmits(['update:modelValue'])

const formData = useVModel(props, 'modelValue', emit)
</script>

